package logic.common.team.processes;

import networking.messages.teamMessages.ProcessCreateMessage;
import fileHandling.language.Lang;
import fileHandling.language.interfaces.HUDText;
import logic.common.team.Team;
import logic.weapons.Weapon;
import logic.weapons.WeaponType;

public class MSWeaponProcess extends TeamProcess {
	
	private Weapon weapon;
	private WeaponType weaponType;
	
	public MSWeaponProcess(Team team, WeaponType weaponType) {
		super(team, MS_WEAPON_TIME);
		this.weaponType = weaponType;
	}
	
	public MSWeaponProcess(Team team, Weapon weapon) {
		this(team, weapon.getWeaponType());
		this.weapon = weapon;
	}
	
	@Override
	public void finish() {
		team.getMotherShip().addWeapon(weapon);
	}
	
	@Override
	public Lang getDescription() {
		switch (weaponType) {
			case Energy: return HUDText.Energy_Weapon;
			case Artillary: return HUDText.Artillary_Weapon;
		}
		return null;
	}
	
	@Override
	public ProcessCreateMessage getProcessCreateMessage() {
		return new ProcessCreateMessage(team.getFraction(), getID(), ProcessType.MSWeapon, weaponType);
	}
}